


//
//IUT de Nice / Departement informatique / Module APO-C++
//Annee 2011_2012 - Package _Banque
//
//Classe AgenceBancaire : gestion d'un ensemble de clients,
//                      titulaires de comptes
//
//Edition A            : TP_8
//
// + Version 1.0.0   : version initiale
//
//Auteur : K.Caucheteur - L.Rombi
// 			fini

public class T_AgenceBancaire_N4_1 {

	public static void main (String[] args) throws Throwable{
		
		Tests.Begin("_Banque.AgenceBancaire", "1.4.0");

		   String adresse_1= "Imm. Les Magnolias Bat. 2, 8 Bd Napoleon III - NICE (06000)";
		   String adresse_2= "Villa Beau Sejour, 115 Av. de la Grande Armee - PARIS (75000)";
		   String adresse_3= "Agence des bosquets 8, avenue Clemenceau - Toulon (83000)";

		   Titulaire dupuy = new Titulaire("DUPUY", "melanie", "1978/04/25", adresse_1);
		   Titulaire durand = new Titulaire("Durand", "Paul", "1981/01/03",  adresse_2);
		   
		   Banque B1= new Banque("S2D","12345", "IUT Info", "01234567891011");
		   
		   //Banque b1 = new Banque();
		   
		      Tests.Design("Controle du service executer", 3);
		      AgenceBancaire ag1 = new AgenceBancaire(B1, adresse_3);
				    
		         ag1.ouvrirCompte(dupuy);
		         ag1.ouvrirCompte(dupuy, 0.06f);
		         ag1.ouvrirCompte(durand);
		         ag1.ouvrirCompte(durand, 0.05f);

		         Tests.Case("Operations sur des comptes courants"); {
		         float solde;

		            solde= ag1.executer(8000001, 'V', "Cheque 567893", 220);
		            Tests.Unit(220, solde);

		            solde= ag1.executer(8000002, 'V', "Guichet 1001", 500);
		            Tests.Unit(500, solde);

		            solde= ag1.executer(8000001, 'R', "Cheque 100543", 120);
		            Tests.Unit(100, solde);

		            solde= ag1.executer(8000002, 'R', "Cheque 76543", 450);
		            Tests.Unit(50, solde);
		         }

		         Tests.Case("Operations sur des comptes epargne"); {
		         float solde;

		            solde= ag1.executer(4000001, 'V', "Cheque 567893", 220);
		            Tests.Unit(220, solde);

		            solde= ag1.executer(4000002, 'V', "Guichet 1001", 500);
		            Tests.Unit(500, solde);

		            solde= ag1.executer(4000001, 'R', "Cheque 100543", 120);
		            Tests.Unit(99.04000091552734, solde);

		            solde= ag1.executer(4000002, 'R', "Cheque 76543", 450);
		            Tests.Unit(50, solde);
		         }

		   Tests.End();
	}
}
